{% load static blog_tags %}
{% get_carousel_list as carousels %}
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
        {% for each in carousels %}
        {% if forloop.counter0 == 0 %}
        <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
        {% else %}
        <li data-target="#carouselExampleIndicators" data-slide-to="{{ forloop.counter0 }}"></li>
        {% endif %}
        {% endfor %}
    </ol>
    <div class="carousel-inner">
        {% for each in carousels %}
        {% if forloop.counter0 == 0 %}
        <div class="carousel-item active">
            {% else %}
            <div class="carousel-item">
                {% endif %}
                <a href="{{ each.url }}">
                    <img class="w-100" src="{{ each.img_url }}" alt="{{ each.content }}">
                </a>
            </div>
            {% endfor %}
        </div>
        <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="sr-only">Previous</span>
        </a>
        <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="sr-only">Next</span>
        </a>
    </div>